package org.pp.controller;

import org.pp.core.Result;
import org.pp.service.IPpPublicFileService;
import org.pp.vo.PublicFileVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**·
 * <p>
 * 文件表 前端控制器
 * </p>
 *
 * @author haima
 */
@RestController
@RequestMapping("/file")
public class PpPublicFileController {

    @Autowired
    IPpPublicFileService fileService;


    @RequestMapping(value = "/upload", method = {RequestMethod.POST, RequestMethod.OPTIONS})
    public Result<PublicFileVo> upload(@RequestParam("file") MultipartFile file){
        return Result.ok(fileService.upload(file));
    }
}
